package com.awei.study.design.action.common;

import java.util.ArrayList;

/**
 * @Author liweilong
 * @Date 2024/8/14 22:36
 */
public class Waiter {
    private ArrayList<Common> commons;

    public Waiter() {
        this.commons = new ArrayList<>();
    }

    public void setCommons(Common common) {
        commons.add(common);
    }

    public void callCook() {
        System.out.println("美女服务员喊话： 来订单啦！！！");
        for (Common common : commons) {
            common.execute();
        }
    }
}
